﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tema_IP_BuyCar
{
    /*class ObjectPool<Client> : List<Client>
    {
        private static int initialized = 0;
      /*  public ObjectPool()
        {
            if (initialized == 0)
                initialized = 1;
            else
                Console.WriteLine("objectpoolfail");
        }*/
        //public void add(Client element)
        //{
        //    this.Add(element);
        //}
    //}
    /*
     *   class Singleton
  {
    private static Singleton instance;

    // Note: Constructor is 'protected' 
    protected Singleton() 
    {
    }

    public static Singleton Instance()
    {
      // Use 'Lazy initialization' 
      if (instance == null)
      {
        instance = new Singleton();
      }

      return instance;
    }
  }
     */
    class ObjectPool : List<Client>

       {
        private static ObjectPool instance;
        protected ObjectPool() 
        {
        }

        public static ObjectPool Instance()
        {
            // Use 'Lazy initialization' 
            if (instance == null)
            {
                instance = new ObjectPool();
            }

            return instance;
        }
        public void Store(Client person)
        {

            this.Add(person);

        }
        

}
}
